package com.unitd.base.module.api.service;

import com.unitd.base.module.api.mybatis.mapper.ApiSearchHistoryMapper;
import com.unitd.base.module.api.entity.SearchHistoryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class ApiSearchHistoryService {
    @Autowired
    private ApiSearchHistoryMapper searchHistoryDao;


    public SearchHistoryVo queryObject(Integer id) {
        return searchHistoryDao.selectById(id);
    }


    public List<SearchHistoryVo> queryList(Map<String, Object> map) {
        return searchHistoryDao.selectByMap(map);
    }


    public int queryTotal(Map<String, Object> map) {
        return searchHistoryDao.queryTotal(map);
    }


    public void save(SearchHistoryVo region) {
        searchHistoryDao.insert(region);
    }


    public void update(SearchHistoryVo region) {
        searchHistoryDao.updateById(region);
    }


    public void delete(Integer id) {
        searchHistoryDao.deleteById(id);
    }

    public void deleteByUserId(Long userId) {
        searchHistoryDao.deleteByUserId(userId);
    }
}
